package com.hyopt.modules.app.controller;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyopt.common.utils.QueryExt;
import com.hyopt.common.utils.R;
import com.hyopt.modules.app.service.CustomInfoService;
import com.tencentcloudapi.asr.v20190614.AsrClient;
import com.tencentcloudapi.asr.v20190614.models.CreateAsyncRecognitionTaskRequest;
import com.tencentcloudapi.asr.v20190614.models.CreateAsyncRecognitionTaskResponse;
import com.tencentcloudapi.asr.v20190614.models.SentenceRecognitionRequest;
import com.tencentcloudapi.asr.v20190614.models.SentenceRecognitionResponse;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Map;

/**
 * @ClassName ApiChatGPTController
 * @Description 智能回复机器人
 * @Author lijie
 * @Date 2023/2/8 13:31 星期三
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/customInfo")
@Api(value = "ApiCustomController", tags = {"获取客户信息"})
public class ApiCustomController {
    @Autowired
    CustomInfoService customInfoService;


    @GetMapping("/page")
    @ApiOperation("获取客户信息")
    public Object list(@RequestParam Map<String, Object> params) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
        if (params.containsKey("endTime")) {
            String end = params.get("endTime").toString();
            params.put("endTime", sdf.format(DateUtil.parse(end)));
        }
        Page page = customInfoService.selectPageCoin(new QueryExt(params));
        return R.ok().put("data", page);
    }

}
